package com.company;
//泛型类的定义
class Box<T,V>{
    private T content;
    private V name;

    public T getContent() {
        return content;
    }

    public void setContent(T content) {
        this.content = content;
    }

    public V getName() {
        return name;
    }

    public void setName(V name) {
        this.name = name;
    }
}

public class TDemo {
    public static void main(String[] args) {
        //使用泛型
        //String类参数
        Box<String,String> box = new Box<String,String>();
        box.setContent("hello!");
        String content = box.getContent();
        System.out.println(content);

        //Inteager类参数
        Box<Integer,String> box1 = new Box<>();
        box1.setContent(45);
        Integer content1 = box1.getContent();
        System.out.println(content1);

        Box<StudentScore,String> box2 = new Box<>();
        box2.setContent(new StudentScore("001", "TOM1", "男", 78, 87, 98));
        StudentScore content2 = box2.getContent();
        System.out.println(content2);
    }
}
